package com.devframe.sysbase.model.base;

import java.io.Serializable;

import com.devframe.sysbase.model.*;
public abstract class BaseTSysUserRole implements Serializable {
	
	public static String REF = "TSysUserRole";
	public static String PROP_USER = "user";
	public static String PROP_ROLE = "role";
	public static String PROP_ID = "id";
	
	
	// constructors
	public BaseTSysUserRole() {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseTSysUserRole(java.lang.String id) {
		this.setId(id);
		initialize();
	}
	
	protected void initialize () {}
	
	private int hashCode = Integer.MIN_VALUE;
	
	private String id;
	
	private TSysUser user;
	
	private TSysRole role;
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}
	
	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof TSysUserRole)) return false;
		else {
			TSysUserRole tSysUserRole = (TSysUserRole) obj;
			if (null == this.getId() || null == tSysUserRole.getId()) return false;
			else return (this.getId().equals(tSysUserRole.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}

	public TSysRole getRole() {
		return role;
	}

	public void setRole(TSysRole role) {
		this.role = role;
	}

	public TSysUser getUser() {
		return user;
	}

	public void setUser(TSysUser user) {
		this.user = user;
	}
}
